Fix SymPy 1.5+ compatibility issue in Kronecker delta simplification for spin enumeration#24
Fix SymPy 1.5+ compatibility issue in Kronecker delta simplification for spin enumeration#24
Conversation
Pull Request Test Coverage Report for Build 17477535967Details
💛 - Coveralls |
Co-authored-by: chenpeizhi <8114085+chenpeizhi@users.noreply.github.com>
Co-authored-by: chenpeizhi <8114085+chenpeizhi@users.noreply.github.com>
|
@copilot Somehow, your previous attempt was interrupted. Continue working on this issue. I noticed that you had difficulty implementing drudge. As I mentioned, you should follow the Installation section in |
|
@copilot You still had difficulty installing the package. Again, do not separately install |
…ification Co-authored-by: chenpeizhi <8114085+chenpeizhi@users.noreply.github.com>
I've successfully installed the project using The failing test Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
tests/spin_one_half_test.py since the simplify_deltas method in drudge/term.py failed to properly simplify a tensor term with a Kronecker delta. Specifically, the summation of a Kronecker delta over a spin dumm failed to simplify...|
Superseded by d9f2cb7 |
The
simplify_deltasmethod indrudge/term.pywas failing to properly simplify Kronecker deltas involving spin enumeration symbols (UP,DOWN) when summed over spin dummy variables. This caused test failures intests/spin_one_half_test.py, specifically in thetest_restricted_parthole_drudge_simplificationtest.The issue manifested as:
The root cause was in the
proc_deltafunction, which had two problems:Intersection handling: The original code assumed specific argument orders when stripping domain intersections from SymPy
solvesetresults, which became unreliable in SymPy 1.5+.Integer range resolution: When solving
KroneckerDelta(SpinOneHalf(0), sigma0), the solutionsigma0 = 0(an integer) couldn't be validated against the spin range becausetry_resolve_range(0, ...)returnedNone.Fixed by:
[start, end)bounds are recognized as valid substitutionsThis fix maintains backward compatibility while resolving the SymPy version compatibility issue that prevented proper simplification of spin-related tensor expressions.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.